package com.bp.hearthealth.pulse.lnapps.notification

import android.app.Activity
import java.lang.ref.WeakReference

/**
 * 前台Activity管理类
 */
object ForegroundActivityManager {

    private var currentActivityWeakRef: WeakReference<Activity>? = null
    private var mIsActive:Boolean = false


    fun getCurrentActivity(): Activity? {
        var currentActivity: Activity? = null
        if (currentActivityWeakRef != null) {
            currentActivity = currentActivityWeakRef?.get()
        }
        return currentActivity
    }


    fun setCurrentActivity(activity: Activity) {
        currentActivityWeakRef = WeakReference(activity)
    }

    fun setActive(isActive:Boolean){
        mIsActive = isActive
    }

    fun getActive():Boolean=mIsActive


}
